public class demo3 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("0");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t2=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("1");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t3=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("2");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t4=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("3");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t5=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("4");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t6=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("5");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t7=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("6");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t8=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("7");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t9=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("8");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t10=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("9");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t11=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("10");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t12=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("11");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t13=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("12");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t14=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("13");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t15=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("14");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t16=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("15");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t17=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("16");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t18=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("17");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t19=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("18");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });
        Thread t20=new Thread(()->{
            try{
                Thread.sleep(1000);
                System.out.println("19");
            }catch (InterruptedException e){
                e.printStackTrace();
            }
        });

        t1.start();
        t1.join();
        t2.start();
        t2.join();
        t3.start();
        t3.join();
        t4.start();
        t4.join();
        t5.start();
        t5.join();
        t6.start();
        t6.join();
        t7.start();
        t7.join();
        t8.start();
        t8.join();
        t9.start();
        t9.join();
        t10.start();
        t10.join();
        t11.start();
        t11.join();
        t12.start();
        t12.join();
        t13.start();
        t13.join();
        t14.start();
        t14.join();
        t15.start();
        t15.join();
        t16.start();
        t16.join();
        t17.start();
        t17.join();
        t18.start();
        t18.join();
        t19.start();
        t19.join();
        t20.start();
        t20.join();
        Thread.sleep(1000);
        System.out.println("OK");
    }
}
